/**
 * <copyright>
 *
 * Copyright (c) 2011 Zeligsoft (2009) Limited
 * All rights reserved.   This program and the accompanying materials
 * are made available under the terms of the Eclipse Public License v1.0
 * which accompanies this distribution, and is available at
 * http://www.eclipse.org/legal/epl-v10.html
 * 
 * Contributors: 
 *   Zeligsoft (2009) Limited - Initial API and implementation
 *
 * </copyright>
 *
 */
package org.omg.deployment.impl;

import org.eclipse.emf.ecore.EClass;
import org.eclipse.emf.ecore.util.FeatureMap;
import org.omg.deployment.DeploymentPackage;
import org.omg.deployment.InstanceResourceDeploymentDescription;
import org.omg.deployment.ResourceUsageKind;

/**
 * <!-- begin-user-doc -->
 * An implementation of the model object '<em><b>Instance Resource Deployment Description</b></em>'.
 * <!-- end-user-doc -->
 * <p>
 * The following features are implemented:
 * <ul>
 *   <li>{@link org.omg.deployment.impl.InstanceResourceDeploymentDescriptionImpl#getResourceUsage <em>Resource Usage</em>}</li>
 * </ul>
 * </p>
 *
 * @generated
 */
public class InstanceResourceDeploymentDescriptionImpl extends
		ResourceDeploymentDescriptionImpl implements
		InstanceResourceDeploymentDescription {
	/**
	 * The default value of the '{@link #getResourceUsage() <em>Resource Usage</em>}' attribute.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @see #getResourceUsage()
	 * @generated
	 * @ordered
	 */
	protected static final ResourceUsageKind RESOURCE_USAGE_EDEFAULT = ResourceUsageKind.NONE;

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	protected InstanceResourceDeploymentDescriptionImpl() {
		super();
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	@Override
	protected EClass eStaticClass() {
		return DeploymentPackage.eINSTANCE
				.getInstanceResourceDeploymentDescription();
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public ResourceUsageKind getResourceUsage() {
		return (ResourceUsageKind) getGroup()
				.get(DeploymentPackage.eINSTANCE
						.getInstanceResourceDeploymentDescription_ResourceUsage(),
						true);
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public void setResourceUsage(ResourceUsageKind newResourceUsage) {
		((FeatureMap.Internal) getGroup()).set(DeploymentPackage.eINSTANCE
				.getInstanceResourceDeploymentDescription_ResourceUsage(),
				newResourceUsage);
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	@Override
	public Object eGet(int featureID, boolean resolve, boolean coreType) {
		switch (featureID) {
		case DeploymentPackage.INSTANCE_RESOURCE_DEPLOYMENT_DESCRIPTION__RESOURCE_USAGE:
			return getResourceUsage();
		}
		return super.eGet(featureID, resolve, coreType);
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	@SuppressWarnings("unchecked")
	@Override
	public void eSet(int featureID, Object newValue) {
		switch (featureID) {
		case DeploymentPackage.INSTANCE_RESOURCE_DEPLOYMENT_DESCRIPTION__RESOURCE_USAGE:
			setResourceUsage((ResourceUsageKind) newValue);
			return;
		}
		super.eSet(featureID, newValue);
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	@Override
	public void eUnset(int featureID) {
		switch (featureID) {
		case DeploymentPackage.INSTANCE_RESOURCE_DEPLOYMENT_DESCRIPTION__RESOURCE_USAGE:
			setResourceUsage(RESOURCE_USAGE_EDEFAULT);
			return;
		}
		super.eUnset(featureID);
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	@Override
	public boolean eIsSet(int featureID) {
		switch (featureID) {
		case DeploymentPackage.INSTANCE_RESOURCE_DEPLOYMENT_DESCRIPTION__RESOURCE_USAGE:
			return getResourceUsage() != RESOURCE_USAGE_EDEFAULT;
		}
		return super.eIsSet(featureID);
	}

} //InstanceResourceDeploymentDescriptionImpl
